package com.yjd.comm.borrow.convert;

import java.util.List;

import com.yjd.comm.borrow.model.BorrowDataModel;
import com.yjd.comm.util.DateUtil;

/**
 * <b>description</b>：借款扩展信息数据转换器 <br>
 * <b>time</b>：2014-11-17下午2:40:36 <br>
 * <b>author</b>： ready likun_557@163.com
 */
public class BorrowDataModelConvert {
	public static BorrowDataModel convert(BorrowDataModel model)
			throws Exception {
		if (model != null) {
			model.getStrMap().put("verify_1_time",
					DateUtil.timestampToDateString(model.getVerify_1_time()));
			model.getStrMap().put("verify_2_time",
					DateUtil.timestampToDateString(model.getVerify_2_time()));
			model.getStrMap().put("verify_3_time",
					DateUtil.timestampToDateString(model.getVerify_3_time()));
			model.getStrMap().put("verify_4_time",
					DateUtil.timestampToDateString(model.getVerify_4_time()));
		}
		return model;
	}

	public static List<BorrowDataModel> convert(List<BorrowDataModel> models)
			throws Exception {
		if (models == null || models.size() == 0) {
			return models;
		}
		for (BorrowDataModel model : models) {
			convert(model);
		}
		return models;
	}
}
